/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       scroll_menu.h

	$Header: /game/scroll_menu.h $

	$NoKeywords: $

 ************************************************************************/
#ifndef SCROLL_MENU_H_INCLUDED
#define SCROLL_MENU_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "bitmap_layer_window_ptr.h"
#include "button.h"
#include "cached_ptr.h"
#include "game_window.h"
#include "handler.h"

class t_bitmap_group;
class t_bitmap_layer;
class t_button;
class t_idle_processor;
class t_scroll_menu;

// --------------------------------------------------------
// menu that animates on open
// --------------------------------------------------------
class t_scroll_menu : public t_window
{
public:
	t_scroll_menu( t_window* parent );
	virtual ~t_scroll_menu();

	void         add_item( std::string const& text, t_handler function, 
		                   std::string const& help_text = "" );
	void         animate();
    virtual void left_button_down( t_mouse_event const& event );
    virtual void left_button_up( t_mouse_event const& event );
    virtual void mouse_move( t_mouse_event const& event );
	void         open( t_screen_point point );
protected:
	void         button_click( t_button* button, t_handler function );

	std::vector<t_bitmap_layer const*>	m_bottom_frames;
	t_bitmap_layer const*               m_background_image;
	t_screen_rect                       m_text_size;
	int									m_final_height;
	int                                 m_frame;
	t_window_ptr						m_top_border;
	t_window_ptr						m_background;
	t_window_ptr						m_bottom_border;
	t_bitmap_window_ptr					m_bottom_scroll;
	t_window_ptr						m_last_mouse_window;
	t_cached_ptr<t_bitmap_group>		m_bitmaps;
	t_idle_processor*					m_animator;
	t_screen_point						m_button_point;
	bool								m_passing_event;
};

#endif // SCROLL_MENU_H_INCLUDED